/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pt.ua.miect.sd.simuladorpesca;
import org.apache.log4j.Logger;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.commons.configuration.Configuration;

/**
 *
 * @author PedroA
 */
public class SimulationConfig {

    public static int NUMBER_OPERATORS = 5;
    public static int NUMBER_BOATS_PER_OPERATORS = 5;
    public static int NUMBER_FISH_SCHOOLS = 5;
    public static int MAX_X_POSITION = 11;
    public static int MAX_Y_POSITION = 11;
    public static int MAX_SHOAL_Y = 2;
    public static long INITIAL_FISH_COUNT = 2000;
    public static long MINIMAL_FISH_COUNT = 30;
    public static float ECOSYSTEM_COEFICIENT = 0.001f;
    public static float GROWTH_RATE = 2.01f;
    public static int PORT_HOME_X = 0;
    public static int PORT_HOME_Y = 0;
    public static int FISH_MOVE_RATIO = 2;
    public static int SPROWNING_SEASON_LENGHT = 40;
    public static int FISHING_SEASON_LENGHT = 100;
    public static int MAX_BOAT_CAPACITY = 100;
    public static int MAX_WAIT = 10;


    private static Configuration conf;

    public static void loadConfiguration(String filePath)
    {
        try {
            conf = new PropertiesConfiguration(filePath);
            NUMBER_OPERATORS = conf.getInt("operators-count");
            NUMBER_BOATS_PER_OPERATORS = conf.getInt("operators-boats");
            NUMBER_FISH_SCHOOLS = conf.getInt("fish-schools");
            INITIAL_FISH_COUNT = conf.getInt("fish-startcount");
            MAX_X_POSITION = conf.getInt("map-xsize");
            MAX_Y_POSITION = conf.getInt("map-ysize");
            GROWTH_RATE = conf.getFloat("fish-growth");
            ECOSYSTEM_COEFICIENT = conf.getFloat("fish-ecocoef");
            PORT_HOME_X = conf.getInt("port-x");
            PORT_HOME_Y = conf.getInt("port-y");
        } catch (ConfigurationException ex) {
            Logger.getLogger(SimulationConfig.class).error(ex);
        }
      
    }





}
